Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all conformance failures other than timeouts/deadlines #274

Merged
merged 6 commits into from
May 17, 2024

Conversation

jhump
Copy link
Member

@jhump jhump commented May 15, 2024

The first two commits include fixes to the protocol logic to fix the known failures in conformance tests.

This still leaves the timeout/deadline propagation cases failing since those will require something more significant to resolve.

  • The first commit fixes how trailers-only responses are classified. This was previously just looking for a "grpc-status" key in the headers. If it was present, it was treating it as a trailers-only response, even if there was a body and/or trailers.
  • The second commit fixes the client to report errors in the face of unexpected response content types. I wish this were less verbose: I think in the future we can likely find some low-hanging fruit ways to improve the code organization and increase code sharing in these protocol implementations (especially gRPC and gRPC-Web).

The third commit is just some minor updates to comments and TODOs that I figured I'd tweak while I was in these files. Hopefully they all make sense.

The final commit cleans up the known failing test case configuration -- to remove everything but the timeout/deadline tests.

@jhump jhump requested review from pkwarren and rebello95 May 15, 2024 01:14
@jhump
Copy link
Member Author

jhump commented May 15, 2024

cc @perezd

Copy link
Contributor

@pkwarren pkwarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - just one suggestion.

@@ -36,3 +36,7 @@ internal class EndStreamResponseJSON(
@Json(name = "error") val error: ErrorPayloadJSON?,
@Json(name = "metadata") val metadata: Headers?,
)

internal fun contentTypeIsJSON(contentType: String): Boolean {
return contentType == "application/json" || contentType == "application/json; charset=utf-8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use MediaType to parse these reliably (we use this in ConnectOkHttpClient.kt)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, that is an okhttp type and helper function. But this is the library module, which intentionally does not have a dependency on okhttp.

This is what the Go implementation does, so despite being hacky, should be adequate. I'll add a TODO that this could be made more robust in the future.

@jhump jhump merged commit 235028c into main May 17, 2024
7 checks passed
@jhump jhump deleted the jh/fix-some-conformance-failures branch May 17, 2024 16:21
rebello95 added a commit to connectrpc/connect-swift that referenced this pull request Jun 8, 2024
This PR includes updates to fix all outstanding conformance test
failures and removes the corresponding opt-outs. All changes are
validated by the conformance test suite.

Many of these fixes are similar to
connectrpc/connect-kotlin#248 and
connectrpc/connect-kotlin#274.

Resolves #268.
Resolves #269.
Resolves #270.

This should also be one of the final changes before v1.0
#222.

---------

Signed-off-by: Michael Rebello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants